import { useModel } from "umi";
import compress from "gql-compress";

const useDeletePosition = () => {
    const { graphqlFetch } = useModel("global");

    const deleteInstitutionPosition = async (reUuid) => {
        let res = await graphqlFetch({
            query,
            variables: { reUuid },
        });
        return res ? true : false;
    };

    return { deleteInstitutionPosition };
};

const query = compress(`mutation MyMutation($reUuid: UUID!) {
    deleteOrganizationInstitutionsMemberByReUuid(input: { reUuid: $reUuid }) {
        clientMutationId
    }
}`);

export default useDeletePosition;
